<?php
	require('connect.php');
	$pdo->query("set names utf8");
	$ip = $_SERVER['REMOTE_ADDR'];
	if(isset($_POST['submit']))
	{
		if(!empty($_POST['delete']))
		{

			foreach($_POST['delete'] as $row)
			{
				$query = 'select wall_ip from wall where wall_id = '.$row;
				$result = $pdo -> query($query);
				foreach($result as $r){
				}
				if($r[0] == $ip)
				{
					$query = 'update wall set wall_delete=1 where wall_id = ?';
					$result = $pdo -> prepare($query);
					$result -> bindParam(1,$row);
					$result -> execute();
				}
				else{
					echo"<script>alert('只能删除自己写的段落哟   您的IP地址：{$ip}');</script>";
				}
			}
		}
	}
?>


<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<script type="text/javascript" src="../js/jquery.min.js"></script>
		<link rel="stylesheet" href="../css/bootstrap.min.css">
		<link rel="icon" href="../img/ico_logo.ico" type="image/gif" sizes="16x16" />
		<script src="../js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="../css/mycss.css">
		<script type="text/javascript"src="../js/jquery.cookie.js"></script>
		<script type="text/javascript"src="../js/myjs.js"></script>
		<script type="text/javascript"src="../js/jquery-ui-1.10.4.custom.js"></script>
		<title>VGEE.cn</title>

	</head>
	<body style="background:#272822;overflow:hidden;">
	<div class="s1">
		<div id="change" style="display:none" class="change"></div>
		<div class="cent">
			<a id="next" class='none glyphicon glyphicon-cloud' href="query.php"></a>
			<h1  id="f1">
			
			</h1>
			<h2 id="f2">

			</h2>
			<p id="author" class="po"></p>
			<p class="right">JailBreak</p>
		</div>
		<div class="s1_right" id="s1_right" >
			<form action="index.php" method="post">
				<div id="right_back"class="glyphicon glyphicon-chevron-right"></div>
				
				<div class="scr_con"id="dv_scroll">
					
					<div id="dv_scroll_text" class="scroll Scroller-Container">
						
							<table id="right_contain">
								<tr>
									<th> 所有段落 </th>
								</tr>
							</table>
						
					</div>
					<div id="dv_scroll_bar">
							<div id="dv_scroll_track" class="Scrollbar-Track">
								<div class="Scrollbar-Handle" style="top: 0px;"></div>
							</div>
					</div>
					<div id="setting"class="glyphicon glyphicon-cog"></div>
					
							
				</div>
				<input class="s1_submit btn btn-danger" type="submit" name="submit" value="删除"/>

			</form>
		</div><!--s1_right>-->
	</div>

	<button id="s1_login" style="display:none" data-toggle="modal" data-target="#login">登录</button>
					<div class="modal fade" id="login"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog" >
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									<h4 class="modal-title" id="myModalLabel">登录</h4>
								</div>
							
								<form id="login_sub"name="loginForm" action="login.php" method="POST">
									<div class="modal-body">
										<div class="row">
											<div class="col-lg-8">
												<div class="input-group">
													<span class="input-group-btn">
														<p class="btn btn-success" type="button">账号</p>
													</span>
													<input type="text" placeholder="输入账号" name="user_name" id="user_name" class="form-control">
												</div>
												<!-- /input-group -->
											</div>
											<!-- /.col-lg-6 -->
										</div>  
										<div class="row">
											<div class="col-lg-8">
												<div class="input-group">
													<span class="input-group-btn">
														<p class="btn btn-success" type="button">密码</p>
													</span>
													<input type="password" pattern="[A-z1-9]{6,20}" name="user_pw" id="user_pw" placeholder="输入密码"class="form-control"></div>
												<!-- /input-group -->
											</div>
											<!-- /.col-lg-6 -->
										</div>
											
									</div>
									 <div class="modal-footer">
								        <button id="" type="submit"name="submit" class="btn btn-success">登录</button>
											<button type="button"  class="btn btn-primary" data-dismiss="modal" data-toggle="modal" data-target="#sign">注册</button>
								      </div>
								</form>
							</div>	<!-- /.modal-content -->
					</div>
			<!-- /.modal-dialog -->


	</body>
</html>
